<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTShader.h</h1><a href="PVRTShader_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTShader.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        OGLES2/PVRTShader</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Shader handling for OpenGL ES 2.0</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 <span class="preprocessor">#ifndef _PVRTSHADER_H_</span>
00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTSHADER_H_</span>
00018 <span class="preprocessor"></span>
00019 <span class="preprocessor">#include "<a class="code" href="PVRTContext_8h.html">PVRTContext.h</a>"</span>
00020 <span class="preprocessor">#include "../PVRTString.h"</span>
00021 <span class="preprocessor">#include "../PVRTError.h"</span>
00022 
00023 <span class="comment">/*!***************************************************************************</span>
00024 <span class="comment"> @Function      PVRTShaderLoadSourceFromMemory</span>
00025 <span class="comment"> @Input         pszShaderCode       shader source code</span>
00026 <span class="comment"> @Input         Type                type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
00027 <span class="comment"> @Output        pObject             the resulting shader object</span>
00028 <span class="comment"> @Output        pReturnError        the error message if it failed</span>
00029 <span class="comment"> @Input         aszDefineArray      Array of defines to be pre-appended to shader string</span>
00030 <span class="comment"> @Input         uiDefArraySize      Size of the define array</span>
00031 <span class="comment"> @Return        PVR_SUCCESS on success and PVR_FAIL on failure (also fills the str string)</span>
00032 <span class="comment"> @Description   Loads a shader source code into memory and compiles it.</span>
00033 <span class="comment">                It also pre-appends the array of defines that have been passed in</span>
00034 <span class="comment">                to the source code before compilation.</span>
00035 <span class="comment">*****************************************************************************/</span>
00036 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a0">PVRTShaderLoadSourceFromMemory</a>(  <span class="keyword">const</span> <span class="keywordtype">char</span>* pszShaderCode,
00037                                             <span class="keyword">const</span> GLenum Type,
00038                                             GLuint* <span class="keyword">const</span> pObject,
00039                                             <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError,
00040                                             <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span>* aszDefineArray=0, GLuint uiDefArraySize=0);
00041 
00042 <span class="comment">/*!***************************************************************************</span>
00043 <span class="comment"> @Function      PVRTShaderLoadBinaryFromMemory</span>
00044 <span class="comment"> @Input         ShaderData      shader compiled binary data</span>
00045 <span class="comment"> @Input         Size            size of shader binary data in bytes</span>
00046 <span class="comment"> @Input         Type            type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
00047 <span class="comment"> @Input         Format          shader binary format</span>
00048 <span class="comment"> @Output        pObject         the resulting shader object</span>
00049 <span class="comment"> @Output        pReturnError    the error message if it failed</span>
00050 <span class="comment"> @Return        PVR_SUCCESS on success and PVR_FAIL on failure (also fills the str string)</span>
00051 <span class="comment"> @Description   Takes a shader binary from memory and passes it to the GL.</span>
00052 <span class="comment">*****************************************************************************/</span>
00053 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a1">PVRTShaderLoadBinaryFromMemory</a>(  <span class="keyword">const</span> <span class="keywordtype">void</span>*  <span class="keyword">const</span> ShaderData,
00054                                             <span class="keyword">const</span> size_t Size,
00055                                             <span class="keyword">const</span> GLenum Type,
00056                                             <span class="keyword">const</span> GLenum Format,
00057                                             GLuint*  <span class="keyword">const</span> pObject,
00058                                             <a class="code" href="classCPVRTString.html">CPVRTString</a>*  <span class="keyword">const</span> pReturnError);
00059 
00060 <span class="comment">/*!***************************************************************************</span>
00061 <span class="comment"> @Function      PVRTShaderLoadFromFile</span>
00062 <span class="comment"> @Input         pszBinFile          binary shader filename</span>
00063 <span class="comment"> @Input         pszSrcFile          source shader filename</span>
00064 <span class="comment"> @Input         Type                type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
00065 <span class="comment"> @Input         Format              shader binary format, or 0 for source shader</span>
00066 <span class="comment"> @Output        pObject             the resulting shader object</span>
00067 <span class="comment"> @Output        pReturnError        the error message if it failed</span>
00068 <span class="comment"> @Input         pContext            Context</span>
00069 <span class="comment"> @Input         aszDefineArray      Array of defines to be pre-appended to shader string</span>
00070 <span class="comment"> @Input         uiDefArraySize      Size of the define array</span>
00071 <span class="comment"> @Return        PVR_SUCCESS on success and PVR_FAIL on failure (also fills pReturnError)</span>
00072 <span class="comment"> @Description   Loads a shader file into memory and passes it to the GL. </span>
00073 <span class="comment">                It also passes defines that need to be pre-appended to the shader before compilation.</span>
00074 <span class="comment">*****************************************************************************/</span>
00075 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a2">PVRTShaderLoadFromFile</a>(  <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> pszBinFile,
00076                                     <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> pszSrcFile,
00077                                     <span class="keyword">const</span> GLenum Type,
00078                                     <span class="keyword">const</span> GLenum Format,
00079                                     GLuint* <span class="keyword">const</span> pObject,
00080                                     <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError,
00081                                     <span class="keyword">const</span> <a class="code" href="structSPVRTContext.html">SPVRTContext</a>* <span class="keyword">const</span> pContext=0,
00082                                     <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span>* aszDefineArray=0, GLuint uiDefArraySize=0);
00083 
00084 <span class="comment">/*!***************************************************************************</span>
00085 <span class="comment"> @Function      PVRTCreateProgram</span>
00086 <span class="comment"> @Output        pProgramObject          the created program object</span>
00087 <span class="comment"> @Input         VertexShader            the vertex shader to link</span>
00088 <span class="comment"> @Input         FragmentShader          the fragment shader to link</span>
00089 <span class="comment"> @Input         pszAttribs              an array of attribute names</span>
00090 <span class="comment"> @Input         i32NumAttribs           the number of attributes to bind</span>
00091 <span class="comment"> @Output        pReturnError            the error message if it failed</span>
00092 <span class="comment"> @Returns       PVR_SUCCESS on success, PVR_FAIL if failure</span>
00093 <span class="comment"> @Description   Links a shader program.</span>
00094 <span class="comment">*****************************************************************************/</span>
00095 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a3">PVRTCreateProgram</a>(   GLuint* <span class="keyword">const</span> pProgramObject,
00096                                 <span class="keyword">const</span> GLuint VertexShader,
00097                                 <span class="keyword">const</span> GLuint FragmentShader,
00098                                 <span class="keyword">const</span> <span class="keywordtype">char</span>** <span class="keyword">const</span> pszAttribs,
00099                                 <span class="keyword">const</span> <span class="keywordtype">int</span> i32NumAttribs,
00100                                 <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError);
00101 
00102 <span class="preprocessor">#endif</span>
00103 <span class="preprocessor"></span>
00104 <span class="comment">/*****************************************************************************</span>
00105 <span class="comment"> End of file (PVRTShader.h)</span>
00106 <span class="comment">*****************************************************************************/</span>
00107 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
